package com.tree.thrive.adapter.openapi;

import com.tree.thrive.business.el.service.ValueService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * top-tree
 *
 * @Auther: cheng.tang
 * @Date: 2023/1/14 4:24 PM
 * @Description:
 */
@RestController
@Slf4j
public class SpringValueController {

    @Autowired
    private ValueService valueService;

    @GetMapping("/ok/attribute")
    public String getValue(HttpServletRequest request) {
        String attributeName = "attributeName";
        request.setAttribute(attributeName, "attributeValue");
        valueService.printList();
        log.info("attributeName {} ", request.getAttribute(attributeName));
        return "ok";
    }


}
